﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TrackIT.Data.Repositories
{
    public class WorkRepository
    {

        public WorkRepository()
        {
        }

        public IEnumerable<WorkLogEntry> GetWorkEntries()
        {
            using (WorkEntryContext context = new WorkEntryContext())
            {
                return context.WorkLogEntries.AsEnumerable();
            }
        }

        public void AddWorkEntry(WorkLogEntry workEntry)
        {
            using(var context = new WorkEntryContext())
            {
                context.WorkLogEntries.Add(workEntry);
                context.SaveChanges();
            }
        }        
    }
}
